using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Web.Mail;

/// <summary>
/// Summary description for General
/// </summary>
public class General
{

    public const string thumb_path = "manager/WebFileManager/Uploads/gallery/thumb/";
    public const string original_path = "manager/WebFileManager/Uploads/gallery/original/";
    public const string large_path = "manager/WebFileManager/Uploads/gallery/large/";
    public const string upload_path = "manager/WebFileManager/Uploads/";
    public const string news_image_path = "manager/WebFileManager/Uploads/news_image/";
    public const string download_path = "manager/WebFileManager/Uploads/download/";
    public const string download_image_path = "../../manager/WebFileManager/Uploads/news_image/";

    public const string photo_path = "manager/WebFileManager/Uploads/photo/";

    public const string hotel_image_path = "manager/WebFileManager/Uploads/hotel_image/";

    public const string tour_image_path = "manager/WebFileManager/Uploads/tour_image/";

    public const string no_image = "images/no_image.gif";
    
    public static bool flag_image = true;

    public static int min_width = 200;

    public static int min_height = 80;

    public static DataSet dsFile = new DataSet("DataSetFileUpload");
    public static DataTable ThumbImage = new DataTable("ThumbImage");
    public static DataTable OriginalImage = new DataTable("OriginalImage");
    public static DataTable LargeImage = new DataTable("LargeImage");

    public static bool flag = false;

    public static String visitors = "0";

	public General()
	{
		//
		// TODO: Add constructor logic here
		//
	}


    public static void ReadFile(string file_path,ref String counter)
    {
        StreamReader objStreamReader = File.OpenText(file_path);
        String tmp_str= objStreamReader.ReadToEnd();
        int tmp = Convert.ToInt32(tmp_str.ToString()) + 1;     
        counter = tmp.ToString();
        objStreamReader.Close();
    }

    public static void WriteFile(string file_path, String counter)
    {
        StreamWriter objFileWriter = File.CreateText(file_path);
        objFileWriter.Write(counter);
        objFileWriter.Close();
    }


    public static void mail_to_company(String from, String to, String subject, String body, String smtpServer)
    {
        MailMessage objEmail = new MailMessage();
        objEmail.BodyFormat = MailFormat.Html; //set mail format to HTML
        objEmail.To = to;
        objEmail.From = from;
        objEmail.Body = body;
        objEmail.Subject = subject;
        SmtpMail.SmtpServer = smtpServer;
        SmtpMail.Send(objEmail);
    }
}
